The automatic rollback only happens if you initiate the transaction via pdo : : begintransaction 只有在通过pdo : : begintransaction ( )启动事务的情况下,才会发生自动回滚。
After set xact abort on is executed , any run - time statement error causes an automatic rollback of the current transaction 在执行set xact _ abort on语句后,任何运行时语句错误都将导致自动回滚当前事务。
I think this is rather inconsistent , that system exceptions cause automatic rollback while application exceptions specifically do not 我认为这是非常矛盾的,系统异常引发了自动回滚而应用程序异常不能。